package com.cxyzy.app_parcelable

import android.content.Intent
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import com.cxyzy.app_parceler.SecondActivity
import com.cxyzy.demo.User
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        textView.setOnClickListener {
            var intent = Intent(this@MainActivity, SecondActivity::class.java)
            val user = User(10, "Andy")
            intent.putExtra("extraKey", user)
            startActivity(intent)
        }
    }
}
